package com.feng.main;

public class DownloadImages extends Thread{

	public void run(){
		
		System.out.println("开始下载");
		
		while(true){
			while(Queues.imgUrlQueue.size() > 0){
				
				//只要有数据就下载
				//可以多线程执行下载
				
					String url = Queues.imgUrlQueue.poll();
					
					System.out.println("开始下载："+url);
					//下载
					new DownLoadImg().downloadImage(url);
					
					Queues.visitedImgUrlQueue.offer(url);
					
					System.out.println("还剩余图片"+Queues.imgUrlQueue.size());
				
				}
		}
		
	}
	
}
